using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class t_AcntGroupMap : EntityTypeConfiguration<t_AcntGroup>
    {
        public t_AcntGroupMap()
        {
            // Primary Key
            this.HasKey(t => new { t.FClassID, t.FGroupID, t.FName, t.FName_CHT, t.FName_EN });

            // Properties
            this.Property(t => t.FClassID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FGroupID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FName)
                .IsRequired()
                .HasMaxLength(26);

            this.Property(t => t.FName_CHT)
                .IsRequired()
                .HasMaxLength(26);

            this.Property(t => t.FName_EN)
                .IsRequired()
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("t_AcntGroup");
            this.Property(t => t.FClassID).HasColumnName("FClassID");
            this.Property(t => t.FGroupID).HasColumnName("FGroupID");
            this.Property(t => t.FName).HasColumnName("FName");
            this.Property(t => t.FName_CHT).HasColumnName("FName_CHT");
            this.Property(t => t.FName_EN).HasColumnName("FName_EN");
        }
    }
}
